import { Component } from '@angular/core';
import { NavController } from 'ionic-angular';
import {HttpService} from "../../Service/HttpService";


@Component({
  selector: 'page-home',
  templateUrl: 'home.html'
})
export class HomePage {

  result:any;

  constructor(public navCtrl: NavController,private http:HttpService) {
//http://gc.ditu.aliyun.com/geocoding?a=%E8%8B%8F%E5%B7%9E%E5%B8%82
    this.http.httpGetNoAuth('./assets/city-data.json').then(res => {
      //返回结果，直接是json形式
      this.result = res;
    }).catch(
      error=>{
        //错误处理
        alert('请求失败！')
      }
    )
  }
}
